#include <stdio.h>
int main()
{
	int a,b,c,r;
	scanf("%d %d",&a,&b);
	c=a*b;
	r=a%b;
	while(r!=0)
	{
		a=b;
		b=r;
		r=a%b;
	}
	c=c/b;
	printf("%d %d",b,c);
	return 0;
}